package com.qianfeng.spring.service.impl;

import com.qianfeng.spring.dao.UserDao;
import com.qianfeng.spring.service.UserService;

/**
 * Created by Zhaohao on 2022/5/20 8:23
 *
 * @version 1.0
 * @auther Zhaohao
 * @since 1.0
 */
public class UserServiceImpl  implements UserService {

    public UserServiceImpl() {

        System.err.println("UserServiceImpl中的方法UserServiceImpl 执行了");

    }

    public void init() {
        System.err.println("UserServiceImpl中的方法init 执行了"+ userDao);
    }


    public void xiaohui() {
        System.err.println("UserServiceImpl中的方法xiaohui 执行了");
    }

    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        System.err.println("UserServiceImpl中的方法setUserDao 执行了");
        this.userDao = userDao;
    }

    @Override
    public void addUser() {
        //需要一个dao
        userDao.addUser();
    }
}